package com.example.designpatterns.creational.factorymethod;

import com.example.designpatterns.creational.factorymethod.factory.JpgReaderFactory;
import com.example.designpatterns.creational.factorymethod.factory.PngReaderFactory;
import com.example.designpatterns.creational.factorymethod.product.Reader;

/**
 * 客户端代码（具体使用）
 *
 * @author scott
 */
public class Client {

    public static void main(String[] args) {
        JpgReaderFactory jpgReaderFactory = new JpgReaderFactory();
        Reader jpgReader = jpgReaderFactory.getReader();
        jpgReader.read();

        PngReaderFactory pngReaderFactory = new PngReaderFactory();
        Reader pngReader = pngReaderFactory.getReader();
        pngReader.read();
    }

}
